package com.yukh.framework.base.net.socket;

import java.net.Socket;

public class SocketUtil {
	public static void main(String[] args) {
		try {
			for(int i=0; i<5; i++){
//				SocketAddress net = new InetSocketAddress("192.168.126.211", 12345);
				Socket socket = new Socket("192.168.126.211", 12345);
//				Socket socket = new Socket("127.0.0.1", 12345);
//				Socket socket = new Socket();
//				socket.bind(net);
				System.out.println("=====connected"+socket.getInetAddress());
				System.out.println("=====connected"+socket.getSoLinger());
				
				Thread.sleep(2000);
				socket.close();
				System.out.println("======close");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
